<?php if(is_array($items) && !empty($items)){?>
<dl class="gallery">
<?php foreach ($items as $key => $photo) {?>
<dt class="corners">	

	<?php $thumb = $this->Html->url('/', true).str_replace(' ',"%20",$fileUpload->image($photo['StoreUpload']['name'],array('autoResize'=>true,'width'=>$params['width'],'imagePathOnly'=>true)));?>
	<?php echo $this->Html->link("&nbsp;", array('plugin'=>'store','controller'=>'products','action' => 'view', $photo['StoreProduct']['id'],Inflector::slug($photo['StoreProduct']['name'],'-')),array('escape'=>false,'class'=>"highslide", 'title'=>$photo['StoreProduct']['name'], 'style'=>"background: url(".$thumb.") center no-repeat;")); ?>

	<?php if($photo['StoreProduct']['price_przecena'] > 0 && $photo['StoreProduct']['price_promocja'] == 0){?>
			<?php $price = "<span class=\"product-view-price-discount color-white\">".$this->Store->price($photo['StoreProduct']['price_detaliczna'],2,'','',$photo['StoreProduct']['currency_id'],$photo['StoreCurrency']['exchange'],$photo['StoreCurrencyDefault']['id'],$photo['StoreCurrencyDefault']['exchange'])."</span>"; ?>			 
			<?php $price .= "<span class=\"product-view-price color-white\"> ". $this->Store->price($photo['StoreProduct']['price_przecena'],2,'',null,$photo['StoreProduct']['currency_id'],$photo['StoreCurrency']['exchange'],$photo['StoreCurrencyDefault']['id'],$photo['StoreCurrencyDefault']['exchange'])."</span> ";?>
			
	<?php }else if( $photo['StoreProduct']['price_promocja'] > 0){?>
			<?php $price = "<span class=\"product-view-price-discount color-white\">".$this->Store->price($photo['StoreProduct']['price_detaliczna'],2,'','',$photo['StoreProduct']['currency_id'],$photo['StoreCurrency']['exchange'],$photo['StoreCurrencyDefault']['id'],$photo['StoreCurrencyDefault']['exchange'])."</span>";?>			 
			<?php $price .= "<span class=\"product-view-price color-white\"> ".$this->Store->price($photo['StoreProduct']['price_promocja'],2,'',null,$photo['StoreProduct']['currency_id'],$photo['StoreCurrency']['exchange'],$photo['StoreCurrencyDefault']['id'],$photo['StoreCurrencyDefault']['exchange'])."</span> ";?> 
			
	<?php }else{?>
			<?php $price = "<span class=\"product-view-price color-white\">".$this->Store->price($photo['StoreProduct']['price_detaliczna'],2,'',null,$photo['StoreProduct']['currency_id'],$photo['StoreCurrency']['exchange'],$photo['StoreCurrencyDefault']['id'],$photo['StoreCurrencyDefault']['exchange'])."</span>";?>
	<?php }?>
	
	<?php echo $this->Html->link($price, array('plugin'=>'store','controller'=>'products','action' => 'view', $photo['StoreProduct']['id'],Inflector::slug($photo['StoreProduct']['name'],'-')),array('escape'=>false,'class'=>'link-more')); ?>

</dt>
<?php }?>
</dl>
<?php }?>